/*
  FILENAME	: setfiledefpath.sql
  Copyright (C) 2013  Testmonger
  See https://maketestdata.codeplex.com/license

  	select * from FileDefinition
	exec setfiledefpath "E:\APPS\InRoad"
*/


IF OBJECT_ID(N'setfiledefpath') IS NOT NULL 
BEGIN
	DROP procedure setfiledefpath
END
GO

CREATE PROCEDURE setfiledefpath	
	@inroad varchar(100)
AS
BEGIN
	DECLARE @tabname nchar(60), @vsql nvarchar(1000), @cnt1 int, @cnt2 int,
		@fcolname nchar(30), @dtype nchar(10), @dlen nchar(10)

	--debug
	--select @cnt1 , @cnt2,@tabname

	update FileDefinition set OutFilePath = ''+@inroad+'\OutTarget\'

	update FileDefinition set InFilePath = ''+@inroad+'\InTemplate\'

	update FileDefinition set InFileName = left(OutFileName,len(outfilename)-4)
	-- select * from filedefinition

END


/*
CREATE TABLE [dbo].[PersonTEMP](AcctNum [nchar](30),DataCode [nchar](30),IntVal [nchar](30),CharVal [nchar](30),DateVal [nchar](30),FloatVal [nchar](30) )

*/
